#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
    int seconds = 0;
    cin >> seconds;
    int hour = 0;
    int min = 0;
    int second = 0;
    min = seconds / 60;
    if (min >= 60)
    {
        hour = min / 60;
        min = min - hour * 60;
    }
    second = seconds - 3600 * hour - 60 * min;
    cout << hour << " " << min << " " << second << " " << endl;
}